<template>
  <XqFormBuild :form="form" :formConfig="formConfig" :rules="rules" :selectMap="selectMap" :dynamicData="dynamicData" :tempData="tempData" @update="onFormUpdate" />
</template>
<script>
import XqFormBuild from "@/components/XqForm/XqFormBuild";
import { buildForm, handleTailValue } from "@/components/XqForm/utils";
import FormJson from "./FormJson";
const customerVO = FormJson.fields.customerVO.extend.fields;
const { form, formConfig, rules, selectMap } = buildForm(customerVO);

export default {
  name: "",
  components: { XqFormBuild },
  mixins: [],
  props: {},
  data() {
    return {
      form,
      formConfig,
      rules,
      selectMap,
      dynamicData: {},
      tempData: {}
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    this.buildDynamicData();
  },
  methods: {
    onFormUpdate(tail, value) {
      handleTailValue(tail, value, this);
    },
    buildDynamicData() {
      const tempDynamicData = {};
      tempDynamicData["health"] = [{ value: "1", label: "健康" }];
      tempDynamicData["sexList"] = [
        { value: 1, label: "男" },
        { value: 2, label: "女" }
      ];
      tempDynamicData["idCardTypeList"] = [
        { value: "MAINLAND", label: "身份证" }
      ];
      tempDynamicData["marriedStatusList"] = [
        { value: 1, label: "未婚" },
        { value: 2, label: "已婚" },
        { value: 3, label: "离异" },
        { value: 4, label: "丧偶" }
      ];
      tempDynamicData["companyName"] = [
        { value: "1", label: "自雇人士" },
        { value: "2", label: "受薪人士" }
      ];
      tempDynamicData["educationLevelList"] = [
        { value: 1, label: "初中及以下" },
        { value: 2, label: "高中及中等专业学校" },
        { value: 3, label: "大专" },
        { value: 4, label: "本科" },
        { value: 5, label: "硕士" },
        { value: 6, label: "博士及以上" }
      ];
      tempDynamicData["positionList"] = [
        { value: 1, label: "法人" },
        { value: 2, label: "股东" },
        { value: 3, label: "高级领导" },
        { value: 4, label: "中级领导" },
        { value: 5, label: "一般员工" },
        { value: 6, label: "其他" }
      ];
      tempDynamicData["agencySatisfiedList"] = [
        { value: 1, label: "是" },
        { value: 0, label: "否" }
      ];
      tempDynamicData["typeList"] = [
        { value: 1, label: "党政及国家机关" },
        { value: 2, label: "事业单位" },
        { value: 3, label: "民办非企业单位（有限公司）" },
        { value: 4, label: "社会团体" },
        { value: 5, label: "个体工商户" }
      ];
      this.dynamicData = tempDynamicData;
    }
  }
};
</script>
